#include("/include/pageForm.html",action="admin/org/search")
<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return navTabSearch(this);"
		action="admin/org/search" method="post">
		<div class="searchBar">
			<ul class="searchContent">
				<li><label>机构编号：</label> <input type="text" name="code"
					value="#(code)" /></li>
				<li><label>机构名称：</label> <input type="text" name="name"
					value="#(name)" /></li>
			</ul>
			<div class="subBar">
				<ul>
					<li><div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">检索</button>
							</div>
						</div></li>
				</ul>
			</div>
		</div>
	</form>
</div>

<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			#auth()
			<li><a class="add" href="admin/org/addPage" target="dialog"><span>添加</span></a></li>
			#end 
			#auth()
			<li><a class="edit" href="admin/org/updatePage?id={sid}"
				target="dialog" warn="请选择一个角色"><span>修改</span></a></li> 
				#end 
				#auth()
			<li><a class="delete" href="admin/org/delete?id={sid}"
				target="ajaxTodo" title="确定要删除吗？"><span>删除</span></a></li> 
				#end
		</ul>
	</div>

	<div id="w_list_print">
		<table class="list" style="width: 98%" targetType="navTab" asc="asc"
			desc="desc" layoutH="116">
			<thead>
				<tr>
					<th width="80">机构编号</th>
					<th width="100">机构名</th>
					<th width="100">创建时间</th>
					<th width="100">更新时间</th>
					<th width="60">操作</th>
				</tr>
			</thead>
			<tbody>
				#for(item:items)
				<tr target="sid" rel="#(item.id)">
					<td>#(item.code )</td>
					<td>#(item.name )</td>
					<td>#(item.createTime )</td>
					<td>#(item.updateTime )</td>
					<td><button onclick="downloadzip('#(item.code )')">下载合同</button></td>
				</tr>
				#end
			</tbody>
		</table>
	</div>


	<script type="text/javascript">
	function isImageExist(url){
		if(url.length==0){
		return false;
		}
		var isExist=true;
		$.ajax(url, {
		         type: 'get',
		         async:false,//取消ajax的异步实现
		         timeout: 1000,
		         success: function() {
		         },
		         error: function() {
		        isExist = false;  
		         }
		    });
		return isExist;
		}
	
			function downloadzip(para){
				var zziip = para+".zip";
				if(true == isImageExist("../../payimg/" +zziip)){
					window.location.href = "admin/org/downloadMyzip?code="+para ;
				}else{
					ajaxTodo("NOT Find:" + zziip);
				}
			}
		</script>

	#include("/include/page.html")

</div>
